#include <jmlib/unitTester/UnitTester.h>

//#include <boost/thread.hpp>

#define JM_ENABLE_LOG_DEBUG
#define JM_ENABLE_LOG_TRACE
#define JM_ENABLE_LOG_SYNCHRONIZATION

#include <jmlib/logger/Log.h>

//JM_USE_EXPLICIT_LOGGER(QWE)

JM_SET_LOGGER_ACTIVE_BY_PREFIX(A)

	
class A {
	JM_USE_LOGGER(A_A)
	//JM_USE_EXPLICIT_LOGGER(AA)
public:
	void ahoj() {
		//JM_LOG_TRACE("Ahoj Jano")
		//JM_LOG_TRACE_EXPLICIT(AA, "Zdar Jano")
		JM_LOG_TRACE("_A_1_" << "_A_2_" << "_A_3_" << "_A_4_")
	}

	void operator()() {ahoj();}
};

class B {
	JM_USE_LOGGER(A_B)
public:
	void ahoj() {
		JM_USE_LOGGER(AXEROX)
		JM_LOG_TRACE("_B_1_" << "_B_2_" << "_B_3_" << "_B_4_")
		//JM_LOG_TRACE_EXPLICIT(QWE, "Ahoj Jano xxxxxxxxxxxxx")
	}

	void operator()() {ahoj();}

};

void fun(int x) {

	//JM_LOG_DEBUG_EXPLICIT(QWE, "Vstupny argument fcie: " 
	//	<< __FUNCTION__ << " je "<< x << ".")
}

//
//LOG_CLASS_2(B)

//LOG_CLASS_2(A)

typedef jmlib::StdCoutLogAppender MyAppender1;
typedef jmlib::StdCoutLogAppender MyAppender2;
JM_ADD_LOG_APPENDER(MyAppender1, "%a %n %m") 
JM_ADD_LOG_APPENDER(MyAppender2, "%a Logger %n in level %l in function %f at line %s logs message: \n%m")

//SET_LOGGER_ACTIVE_BY_PREFIX(A_A)
//SET_LOGGER_ACTIVE(A_B)
JM_SET_LOGGER_ACTIVE_BY_PREFIX(AA, JM_ALL_APPENDERS)

int main(int argc, char *argv[]) {

	
	A a;	
	B b;
	a();
	b();
	//boost::thread t1(a);
	//boost::thread t2(b);
	//t1.join();
	//t2.join();

	//JM_LOG_TRACE("Trace log!")
	//JM_LOG_DEBUG("Debug log!")
	//JM_LOG_INFO("Info log!")
	//JM_LOG_WARN("Warn log!")
	//JM_LOG_ERROR("Error log!")
	//jmlib::UnitTester::getInstance()->runTests();
}
